package com.ouyang.service;

import com.ouyang.mapper.QuestionMapper;
import com.ouyang.mapper.po.QuestionPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class QuestionService {
    @Autowired
    private QuestionMapper questionMapper;

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void addQuestionFromAI(List<QuestionPO> questionPOList) {

        questionPOList.forEach(e -> {
            questionMapper.addQuestion(e);
        });

    }
}
